package com.mmche.filter;
/***********************************************************************
*
* @model   公共Web检测过滤器
* @author  wjk
* @version 1.0
* @purpose 业务系统利用此类进行Web程序权限的过滤   
*
***********************************************************************/



import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.framework.web.context.WebApplicationContext;
public class NoFilterChecker implements Filter{

	
	//Filter config
	private FilterConfig config;
	
	public void init(FilterConfig config) throws ServletException {
		this.config = config;
	}
	
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		ServletContext servletContext = this.config.getServletContext();
		HttpServletRequest httpServletRequest = (HttpServletRequest) request;
		HttpServletResponse httpServletResponse = (HttpServletResponse) response;
		//WebApplicationContext初始化
		WebApplicationContext.initialize(servletContext,httpServletRequest, httpServletResponse);
	   chain.doFilter(httpServletRequest, httpServletResponse);
	   return;
	}
	public void destroy() {

	}
	
}
